import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '任务名称',
    align:"center",
    dataIndex: 'taskName'
   },
   {
    title: '任务类型',
    align:"center",
    dataIndex: 'type'
   },
   {
    title: '任务内容',
    align:"center",
    dataIndex: 'taskContent'
   },
   {
    title: '交付节点',
    align:"center",
    dataIndex: 'deliveryNode'
   },
   {
    title: '交付对象',
    align:"center",
    dataIndex: 'deliveryObject'
   },
   {
    title: '交付物',
    align:"center",
    dataIndex: 'article'
   },
   {
    title: '是否涉密',
    align:"center",
    dataIndex: 'classified'
   },
   {
    title: '进度',
    align:"center",
    dataIndex: 'schedule'
   },
   {
    title: '开始时间',
    align:"center",
    dataIndex: 'startTime'
   },
   {
    title: '结束时间',
    align:"center",
    dataIndex: 'endTime'
   },
   {
    title: '附件',
    align:"center",
    dataIndex: 'annex'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '任务名称',
    field: 'taskName',
    component: 'Input',
  },
  {
    label: '任务类型',
    field: 'type',
    component: 'Input',
  },
  {
    label: '任务内容',
    field: 'taskContent',
    component: 'Input',
  },
  {
    label: '交付节点',
    field: 'deliveryNode',
    component: 'Input',
  },
  {
    label: '交付对象',
    field: 'deliveryObject',
    component: 'Input',
  },
  {
    label: '交付物',
    field: 'article',
    component: 'Input',
  },
  {
    label: '是否涉密',
    field: 'classified',
    component: 'Input',
  },
  {
    label: '进度',
    field: 'schedule',
    component: 'Input',
  },
  {
    label: '开始时间',
    field: 'startTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '结束时间',
    field: 'endTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '附件',
    field: 'annex',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  taskName: {title: '任务名称',order: 0,view: 'text', type: 'string',},
  type: {title: '任务类型',order: 1,view: 'text', type: 'string',},
  taskContent: {title: '任务内容',order: 2,view: 'text', type: 'string',},
  deliveryNode: {title: '交付节点',order: 3,view: 'text', type: 'string',},
  deliveryObject: {title: '交付对象',order: 4,view: 'text', type: 'string',},
  article: {title: '交付物',order: 5,view: 'text', type: 'string',},
  classified: {title: '是否涉密',order: 6,view: 'text', type: 'string',},
  schedule: {title: '进度',order: 7,view: 'text', type: 'string',},
  startTime: {title: '开始时间',order: 8,view: 'datetime', type: 'string',},
  endTime: {title: '结束时间',order: 9,view: 'datetime', type: 'string',},
  annex: {title: '附件',order: 10,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}